package cn.fj.big.spring.http.invoker.demo.config;

import cn.fj.big.spring.http.invoker.demo.api.ITestService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean;

/**
 * Created by LiJianXin on 2019/2/27 0027.
 */
@Configuration
public class ClientConfiguration {

	@Value("${test.service.url}")
	private String testServiceUrl;

	@Bean
	public HttpInvokerProxyFactoryBean testService() {
		HttpInvokerProxyFactoryBean httpInvokerProxyFactoryBean = new HttpInvokerProxyFactoryBean();
		httpInvokerProxyFactoryBean.setServiceUrl(testServiceUrl);
		httpInvokerProxyFactoryBean.setServiceInterface(ITestService.class);
		return httpInvokerProxyFactoryBean;
	}
}
